import org.apache.spark.{SparkConf, SparkContext}

object RDDNumberTest {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local[6]").setAppName("number_test")
    val sc = new SparkContext(conf)
    val rdd = sc.parallelize(Seq(1,2,3,4))
    println("元素个数:"+rdd.count())
    println("平均值:"+rdd.mean())
    println("和:"+rdd.sum())
    println("最大值:"+rdd.max())
    println("最小值:"+rdd.min())
    println("方差:"+rdd.variance())
    println("采样的方差:"+rdd.sampleVariance())
    println("标准差:"+rdd.stdev())
    println("采样中的标准差:"+rdd.sampleStdev())
  }
}
